package com.eastfair.venueservice.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.core.base.entity.Entity;
import com.eastfair.database.mybatis.typehandler.M9EncryptHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * 智慧物流服务-仓储服务
 *
 * @author Du Xiaobo
 * @date 2023/5/8 17:40
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value="vsm_logistics_storage",autoResultMap = true)
@ApiModel(value = "LoadInfo", description = "智慧物流服务-仓储服务")
@AllArgsConstructor
public class StorageInfo extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 4438209056045623446L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();

    /**
     * 是否启用（确认状态）：1是 已确认；0否 未确认
     */
    @ApiModelProperty(value = "是否启用（确认状态）：1是 已确认；0否 未确认")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用（确认状态）：1是 已确认；0否 未确认")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;


    /**
     * 主体类型
     */
    @ApiModelProperty(value = "主体类型")
    @TableField(value = "principal_type")
    @Excel(name = "主体类型")
    private String principalType;

    /**
     * 企业名称
     */
    @ApiModelProperty(value = "企业名称")
    @TableField(value = "enterprise_name")
    @Excel(name = "企业名称")
    private String enterpriseName;

    /**
     * 社会统一代码
     */
    @ApiModelProperty(value = "社会统一代码")
    @TableField(value = "social_unified_code")
    @Excel(name = "社会统一代码")
    private String socialUnifiedCode;

    /**
     * 展会id
     */
    @ApiModelProperty(value = "展会id")
    @TableField(value = "exhibition_id")
    @Excel(name = "展会id")
    private Long exhibitionId;

    /**
     * 展会名称
     */
    @ApiModelProperty(value = "展会名称")
    @TableField(value = "exhibition_name")
    @Excel(name = "展会名称")
    private String exhibitionName;

    /**
     * 展厅号
     */
    @ApiModelProperty(value = "展厅号")
    @TableField(value = "exhibition_hall_no")
    @Excel(name = "展厅号")
    private String exhibitionHallNo;

    /**
     * 展位号
     */
    @ApiModelProperty(value = "展位号")
    @TableField(value = "booth_no")
    @Excel(name = "展位号")
    private String boothNo;

    /**
     * 联系人
     */
    @ApiModelProperty(value = "联系人")
    @TableField(value = "contact")
    @Excel(name = "联系人")
    private String contact;

    /**
     * 联系方式
     */
    @ApiModelProperty(value = "联系方式")
    @TableField(value = "telephone",typeHandler = M9EncryptHandler.class)
    @Excel(name = "联系方式")
    private String telephone;

    /**
     * 货物名称
     */
    @ApiModelProperty(value = "货物名称")
    @TableField(value = "goods_name")
    @Excel(name = "货物名称")
    private String goodsName;

    /**
     * 货物数量
     */
    @ApiModelProperty(value = "货物数量")
    @TableField(value = "goods_number")
    @Excel(name = "货物数量")
    private Integer goodsNumber;

    /**
     * 货物总重量
     */
    @ApiModelProperty(value = "货物总重量")
    @TableField(value = "goods_weight")
    @Excel(name = "货物总重量")
    private BigDecimal goodsWeight;

    @ApiModelProperty(value = "重量单位")
    @TableField(value = "weight_unit")
    @Excel(name = "重量单位")
    private String weightUnit;

    /**
     * 预计货物总体积
     */
    @ApiModelProperty(value = "预计货物总体积")
    @TableField(value = "estimate_volume")
    @Excel(name = "预计货物总体积")
    private BigDecimal estimateVolume;
    /**
     * 实际货物总体积
     */
    @ApiModelProperty(value = "实际货物总体积")
    @TableField(value = "actual_volume")
    @Excel(name = "实际货物总体积")
    private BigDecimal actualVolume;

    /**
     * 体积单位
     */
    @ApiModelProperty(value = "体积单位")
    @TableField(value = "volume_unit")
    @Excel(name = "体积单位")
    private String volumeUnit;

    /**
     * 预计入库日期
     */
    @ApiModelProperty(value = "预计入库日期")
    @TableField(value = "estimate_input_date")
    @Excel(name = "预计入库日期")
    private LocalDate estimateInputDate;

    @ApiModelProperty(value = "实际入库日期")
    @TableField(value = "actual_input_date")
    @Excel(name = "实际入库日期")
    private LocalDate actualInputDate;

    @ApiModelProperty(value = "预计出库日期")
    @TableField(value = "estimate_output_date")
    @Excel(name = "预计出库日期")
    private LocalDate estimateOutputDate;

    @ApiModelProperty(value = "实际出库日期")
    @TableField(value = "actual_output_date")
    @Excel(name = "实际出库日期")
    private LocalDate actualOutputDate;

    @ApiModelProperty(value = "预定数量")
    @TableField(value = "estimate_number")
    @Excel(name = "预定天数")
    private Integer estimateNumber;

    @ApiModelProperty(value = "预定数量单位")
    @TableField(value = "estimate_number_unit")
    @Excel(name = "预定数量单位")
    private String estimateNumberUnit;

    /**
     * 预计计费总价
     */
    @ApiModelProperty(value = "预计计费总价")
    @TableField(value = "estimated_cost")
    @Excel(name = "预计计费总价")
    private BigDecimal estimatedCost;

    /**
     * 实际计费总价
     */
    @ApiModelProperty(value = "实际计费总价")
    @TableField(value = "actual_cost")
    @Excel(name = "实际计费总价")
    private BigDecimal actualCost;

    /**
     * 提交时间
     */
    @ApiModelProperty(value = "提交时间")
    @TableField(value = "submit_time")
    @Excel(name = "提交时间")
    private LocalDateTime submitTime;

    /**
     * 审核时间
     */
    @ApiModelProperty(value = "审核时间")
    @TableField(value = "examine_time")
    @Excel(name = "审核时间")
    private LocalDateTime examineTime;

    /**
     * 审核状态
     */
    @ApiModelProperty(value = "审核状态")
    @TableField(value = "examine_state")
    @Excel(name = "审核状态")
    private String examineState;

    /**
     * 审核理由
     */
    @ApiModelProperty(value = "审核理由")
    @TableField(value = "examine_reason")
    @Excel(name = "审核理由")
    private String examineReason;

    @Builder

    public StorageInfo(Long id, LocalDateTime createTime, Long createdBy, LocalDateTime updateTime, Long updatedBy, Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, String principalType, String enterpriseName, String socialUnifiedCode, Long exhibitionId, String exhibitionName, String exhibitionHallNo, String boothNo, String contact, String telephone, String goodsName, Integer goodsNumber, BigDecimal goodsWeight, String weightUnit, BigDecimal estimateVolume, BigDecimal actualVolume, String volumeUnit, LocalDate estimateInputDate, LocalDate actualInputDate, LocalDate estimateOutputDate, LocalDate actualOutputDate, Integer estimateNumber, String estimateNumberUnit, BigDecimal estimatedCost, BigDecimal actualCost, LocalDateTime submitTime, LocalDateTime examineTime, String examineState, String examineReason) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.principalType = principalType;
        this.enterpriseName = enterpriseName;
        this.socialUnifiedCode = socialUnifiedCode;
        this.exhibitionId = exhibitionId;
        this.exhibitionName = exhibitionName;
        this.exhibitionHallNo = exhibitionHallNo;
        this.boothNo = boothNo;
        this.contact = contact;
        this.telephone = telephone;
        this.goodsName = goodsName;
        this.goodsNumber = goodsNumber;
        this.goodsWeight = goodsWeight;
        this.weightUnit = weightUnit;
        this.estimateVolume = estimateVolume;
        this.actualVolume = actualVolume;
        this.volumeUnit = volumeUnit;
        this.estimateInputDate = estimateInputDate;
        this.actualInputDate = actualInputDate;
        this.estimateOutputDate = estimateOutputDate;
        this.actualOutputDate = actualOutputDate;
        this.estimateNumber = estimateNumber;
        this.estimateNumberUnit = estimateNumberUnit;
        this.estimatedCost = estimatedCost;
        this.actualCost = actualCost;
        this.submitTime = submitTime;
        this.examineTime = examineTime;
        this.examineState = examineState;
        this.examineReason = examineReason;
    }
}
